// https://leetcode-cn.com/problems/isomorphic-strings/
class Solution {
public:
    bool isIsomorphic(string s, string t) {
        if (s.size() - t.size()) return false;
        int st[128] = {0}, ts[128] = {0};
        for (int i = 0; s[i]; i++) {
            if (st[s[i]] == 0) st[s[i]] = t[i];
            else if (t[i] - st[s[i]]) return false;
            if (ts[t[i]] == 0) ts[t[i]] = s[i];
            else if (s[i] - ts[t[i]]) return false;
        }
        return true;
    }
};